<?php 
header("Content-type: text/html; charset=utf-8"); 



// 取数据
$db = include './db.php';

session_start();
// var_dump($_SESSION);


$color = ['alert-success','alert-info','alert-warning','alert-danger'];


$num = 3;
$count = count($db);
$pages = ceil($count/$num);


if(isset($_GET['p'])){
	$page =$_GET['p'];
}else{
	$page =1;
}

// var_dump("现在是第".$page."页");
// var_dump("从哪里开始取".($page-1)*$num);exit;

$db = array_slice($db,($page-1)*$num,$num,true);

// if($page<>1){
// 	echo "<a href='./index.php?p=".($page-1)."'>上一页</a>";
// }

// for ($i=1; $i <=$pages ; $i++) {
	 
// 	echo "<a href='./index.php?p=".$i."'>".$i."</a>";
	
// }
// if($page<>$pages){
// 	echo "<a href='./index.php?p=".($page+1)."'>下一页</a>";
// }


include './Tpl/index.html';










 ?>